<div class="wrapper wrapper-content animated fadeInRight">
    <!-- PAGE CONTENT BEGINS -->
    <div class="row">
        <div class="col-xs-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>搜索</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="table-responsive">
                            <form class="form-search" method="get" action="<?=url('ktv.enroll/index')?>" role="form">
                                <table>
                                    <tr>
                                        <!--<td>包间:<input class="form-control" name="room_id" id="room_id"-->
                                                      <!--value="<?=$search['room_id']?>" type="text" placeholder="请输入包间"-->
                                                      <!--style=" width:200px"/></td>-->
                                        <td>联系人:<input class="form-control" name="name" id="name"
                                                       value="<?=$search['name']?>" type="text" placeholder="请输入联系人"
                                                       style=" width:200px"/></td>
                                        <td>联系方式:<input class="form-control" name="mobile" id="mobile"
                                                        value="<?=$search['mobile']?>" type="text" placeholder="请输入联系方式"
                                                        style=" width:200px"/></td>
                                        <td>状态:
                                                <select class="form-control" name="status">
                                                    <option  <?=$search['status'] == 10 ? 'selected' : ''?> value="10">请选择</option>
                                                    <option <?=$search['status'] == 0 ? 'selected' : ''?> value="0">待处理</option>
                                                    <option <?=$search['status'] == 2 ? 'selected' : ''?> value="2">拒绝预约</option>
                                                    <option <?=$search['status'] == 1 ? 'selected' : ''?> value="1">接受预约</option>
                                                    <option <?=$search['status'] == 3 ? 'selected' : ''?> value="3">已消费</option>
                                                </select>
                                        </td>
                                        <td>
                                            <div class="input-group">
                                                <button type="submit" style="margin-top: 42%" class="btn form-control btn-sm btn-primary">搜索
                                                </button>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div class="col-xs-12">
            <div class="ibox-content">
                <div class="row">
                    <div class="tableTools-container">
                        <a title="添加预约管理" href="<?=url('ktv.enroll/create')?>" class="btn btn-sm btn-success"><i
                                class=" fa fa-plus"></i>添加预约管理</a>
                    </div>


                    <div class="table-responsive">

                        <table id="simple-table" class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>包间</th>
                                <th>联系人</th>
                                <th>联系方式</th>
                                <th>预约日期</th>
                                <th>预约时长</th>
                                <th>状态</th>
                                <th>操作</th>


                            </tr>
                            </thead>
                            <form id="mini_list">
                                <tbody>
                                <?php foreach($list as $val){ ?>
                                <tr>
                                    <td><?= $val->enroll_id ?></td>
                                    <td><?=empty($rooms[$val->room_id]) ? '' : $rooms[$val->room_id]->title?></td>
                                    <td><?=$val->name?></td>
                                    <td><?=$val->mobile?></td>
                                    <td><?=$val->enroll_date?></td>
                                    <td><?=$val->enroll_time <=5 ?  $val->enroll_time.'小时' : '包夜'?></td>
                                    <td><?=empty($status[$val->status]) ? '' : $status[$val->status]?></td>
                                    <td>
                                        <div class="hidden-sm hidden-xs btn-group">
                                            <a style="margin-left: 10px" title="删除预约管理" mini="act" href="<?=url('ktv.enroll/delete','enroll_id='.$val->enroll_id)?>" class="btn btn-xs btn-warning"><i class="fa fa-trash bigger-120"></i>删除</a>
                                             <?php if($val->status == 0) { ?>
                                               <a style="margin-left: 10px"  title="拒绝此预约？" mini="act" href="<?=url('ktv.enroll/no','enroll_id='.$val->enroll_id)?>" class="btn btn-xs btn-danger">拒绝预约</a>
                                               <a style="margin-left: 10px"  title="接受此预约" mini="act" href="<?=url('ktv.enroll/yes','enroll_id='.$val->enroll_id)?>" class="btn btn-xs btn-success">接受预约</a>
                                             <?php }elseif($val->status == 1) { ?>
                                               <a style="margin-left: 10px"  title="设为已消费" mini="act" href="<?=url('ktv.enroll/ok','enroll_id='.$val->enroll_id)?>" class="btn btn-xs btn-primary">设为已消费</a>
                                            <?php } ?>
                                        </div>
                                    </td>
                                </tr>
                                <?php } ?>

                                </tbody>
                            </form>
                        </table>

                        <div>
                            <?php echo $page; ?>
                        </div>
                    </div><!-- /.row -->


                </div><!-- /.main-container -->


            </div>
        </div>
    </div>
</div>
